#----------------------------------------------------------------------------#
# Makefile for Pessoa							     #
# University of California, Los Angeles                                      #
# Version @VERSION@, June, 2009	                                     	     #
#----------------------------------------------------------------------------#


MEXSUFFIX  = mex
DIR        = ../..

MEX        = @MEX@
CXX        = @CXX@
OBJFILES   = $(CUDD_DIR)/util/datalimit.o $(CUDD_DIR)/util/cpu_time.o $(CUDD_DIR)/util/safe_mem.o $(DIR)/library/src/pessoa.o
CFLAGS     = -L$(MATLABHOME)/bin/$(SYSTEMEX) -L$(CUDD_DIR)/dddmp -L$(CUDD_DIR)/epd -L$(CUDD_DIR)/util -L$(CUDD_DIR)/st -L$(CUDD_DIR)/mtr -L$(CUDD_DIR)/cudd -L$(CUDD_DIR)/include
LIBS       = -lmex -lmx -lmat -lcudd -lmtr -lst -lutil -lepd -ldddmp
INCLUDE    = -I$(MATLABHOME)/extern/include -I$(CUDD_DIR)/include -I$(DIR)/library/src
MEXFLAGS   = -cxx CC='$(CXX)' CXX='$(CXX)' LD='$(CXX)'

all: pessoa_combine.$(MEXSUFFIX) pessoa_set2bdd.$(MEXSUFFIX) pessoa_charf2bdd.$(MEXSUFFIX) pessoa_compare_sets.$(MEXSUFFIX)
 
pessoa_combine.$(MEXSUFFIX): pessoa_combine.cpp 
		  $(MEX) $(MEXFLAGS) $(CFLAGS) $(INCLUDE) $(LIBS) $(OBJFILES) $^ -output ../bin/pessoa_combine

pessoa_set2bdd.$(MEXSUFFIX): pessoa_set2bdd.cpp 
		  $(MEX) $(MEXFLAGS) $(CFLAGS) $(INCLUDE) $(LIBS) $(OBJFILES) $^ -output ../bin/pessoa_set2bdd

pessoa_charf2bdd.$(MEXSUFFIX): pessoa_charf2bdd.cpp 
		  $(MEX) $(MEXFLAGS) $(CFLAGS) $(INCLUDE) $(LIBS) $(OBJFILES) $^ -output ../bin/pessoa_charf2bdd

pessoa_compare_sets.$(MEXSUFFIX): pessoa_compare_sets.cpp 
		  $(MEX) $(MEXFLAGS) $(CFLAGS) $(INCLUDE) $(LIBS) $(OBJFILES) $^ -output ../bin/pessoa_compare_sets
